package com.example.myapplication.carinspection;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.myapplication.R;

public class CarinspectionActivity extends AppCompatActivity {

    private ImageView but_lawyerList;
    private LinearLayout li_appointment;
    private TextView text_management;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_carinspection);
        initview();
        //返回
        but_bloak();
        //添加预约
        addappointment();
        //车辆管理
        vehiclemanagement();
        //弹窗须知
        popupnotice();

    }

    private void vehiclemanagement() {
        text_management.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(CarinspectionActivity.this,VehiclemanagementnActivity.class);
                CarinspectionActivity.this.startActivity(intent);
            }
        });
    }

    private void addappointment() {
        li_appointment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(CarinspectionActivity.this,AppointmentActivity.class);
                CarinspectionActivity.this.startActivity(intent);
            }
        });
    }

    @Override
    protected void onResume() {

        super.onResume();

    }

    private void popupnotice() {
        AlertDialog.Builder builder = new AlertDialog.Builder(CarinspectionActivity.this);
        View inflate = LayoutInflater.from(CarinspectionActivity.this).inflate(R.layout.item_popupnotice, null);
        builder.setView(inflate);
        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {

            }
        });
        builder.create().show();
    }

    private void but_bloak() {
        but_lawyerList.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                CarinspectionActivity.this.finish();
            }
        });
    }

    private void initview() {
        but_lawyerList = findViewById(R.id.but_lawyerList);
        li_appointment = findViewById(R.id.li_appointment);
        text_management = findViewById(R.id.text_management);
    }
}